package com.bifrost.cbentity;

import javax.persistence.*;

/**
 * @author rangf
 * @date 2018/2/27
 */
@Entity
@Table(name = "BHWSC_MD")
public class SapStore {
    private String kunnr;
    private String name1;
    private String betrp;
    private String stras;
    private String telf1;
    private String dstatus;
    private String ddate;
    private Long noid;

    @Basic
    @Column(name = "KUNNR", nullable = true, length = 10)
    public String getKunnr() {
        return kunnr;
    }

    public void setKunnr(String kunnr) {
        this.kunnr = kunnr;
    }

    @Basic
    @Column(name = "NAME1", nullable = true, length = 140)
    public String getName1() {
        return name1;
    }

    public void setName1(String name1) {
        this.name1 = name1;
    }

    @Basic
    @Column(name = "BETRP", nullable = true, length = 4)
    public String getBetrp() {
        return betrp;
    }

    public void setBetrp(String betrp) {
        this.betrp = betrp;
    }

    @Basic
    @Column(name = "STRAS", nullable = true, length = 140)
    public String getStras() {
        return stras;
    }

    public void setStras(String stras) {
        this.stras = stras;
    }

    @Basic
    @Column(name = "TELF1", nullable = true, length = 16)
    public String getTelf1() {
        return telf1;
    }

    public void setTelf1(String telf1) {
        this.telf1 = telf1;
    }

    @Basic
    @Column(name = "DSTATUS", nullable = true, length = 1)
    public String getDstatus() {
        return dstatus;
    }

    public void setDstatus(String dstatus) {
        this.dstatus = dstatus;
    }

    @Basic
    @Column(name = "DDATE", nullable = true, length = 14)
    public String getDdate() {
        return ddate;
    }

    public void setDdate(String ddate) {
        this.ddate = ddate;
    }

    @Id
    @SequenceGenerator(name= "sequence",sequenceName="sequence_store" ,allocationSize=1)
    @GeneratedValue(generator= "sequence",strategy= GenerationType.SEQUENCE)
    @Column(name = "NOID", nullable = false, precision = 0)
    public Long getNoid() {
        return noid;
    }

    public void setNoid(Long noid) {
        this.noid = noid;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SapStore sapStore = (SapStore) o;

        if (noid != sapStore.noid) return false;
        if (kunnr != null ? !kunnr.equals(sapStore.kunnr) : sapStore.kunnr != null) return false;
        if (name1 != null ? !name1.equals(sapStore.name1) : sapStore.name1 != null) return false;
        if (betrp != null ? !betrp.equals(sapStore.betrp) : sapStore.betrp != null) return false;
        if (stras != null ? !stras.equals(sapStore.stras) : sapStore.stras != null) return false;
        if (telf1 != null ? !telf1.equals(sapStore.telf1) : sapStore.telf1 != null) return false;
        if (dstatus != null ? !dstatus.equals(sapStore.dstatus) : sapStore.dstatus != null) return false;
        if (ddate != null ? !ddate.equals(sapStore.ddate) : sapStore.ddate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = kunnr != null ? kunnr.hashCode() : 0;
        result = 31 * result + (name1 != null ? name1.hashCode() : 0);
        result = 31 * result + (betrp != null ? betrp.hashCode() : 0);
        result = 31 * result + (stras != null ? stras.hashCode() : 0);
        result = 31 * result + (telf1 != null ? telf1.hashCode() : 0);
        result = 31 * result + (dstatus != null ? dstatus.hashCode() : 0);
        result = 31 * result + (ddate != null ? ddate.hashCode() : 0);
        result = 31 * result + (int) (noid ^ (noid >>> 32));
        return result;
    }
}
